import axios from '../../axios';
const STUDENTS_URL = '/salesmans';

const salesmansApi = {
  login(data) {
    return axios({
      url: STUDENTS_URL + '/salesmanLogin',
      method: 'post',
      data,
    });
  },
  getAllSalesmans() {
    return axios({
      url: STUDENTS_URL + "/getAllSalesmans",
      method: "get",
    })
  },
  addOneSalesman(data) {
    return axios({
      url: STUDENTS_URL + "/addOneSalesman",
      method: "post",
      data
    })
  },
  getOneSalesman(_id) {
    return axios({
      url: STUDENTS_URL + "/getOneSalesman",
      method: "post",
      data: { _id }
    })
  },
  updateOneSalesman(data) {
    return axios({
      url: STUDENTS_URL + "/updateOneSalesman",
      method: "post",
      data
    })
  },
  updatePasswordSalesman(data) {
    return axios({
      url: STUDENTS_URL + "/updatePasswordSalesman",
      method: "post",
      data
    })
  },
  deleteOneSalesman(_id) {
    return axios({
      url: STUDENTS_URL + "/deleteOneSalesman",
      method: "post",
      data: { _id }
    })
  },
};

export default salesmansApi;